
#ifndef __DOM_DOCUMENT_H
#define __DOM_DOCUMENT_H

#include <libxml/xmlwriter.h>

class DOMDocument
{
   public:
      DOMDocument(const char *buffer, int length);
      DOMDocument(const char *filename);
      DOMDocument();
      ~DOMDocument();
      xmlNodePtr GetRootNode();
      void GenerateRootNode(const char *name);
      void SetProperty(xmlNodePtr node, const char *key, const char *value);
      xmlNodePtr CreateChildNode(xmlNodePtr node, const char *name);
      xmlNodePtr FindNode(xmlNodePtr node, const char *name);
      xmlNodePtr FindNode(xmlNodePtr node, const char *name, const char *attribname, const char *attribvalue);
      int HasAttrib(xmlNodePtr node, const char *attribname);
      char *GetAttribValueString(xmlNodePtr node, const char *attribname);
      int ReadIn(const char *buffer, int length);
      int ReadIn(const char *filename);
      int WriteOut(const char *filename);
      int WriteOut(xmlBufferPtr buffer);
      xmlDocPtr tdoc;
};

#endif
